package com.jinbiao.app.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jinbiao.model.Member;
import com.jinbiao.service.MemberService;

/**
 * controller层    就是我们的web层应用   
 * @author EX_WLJR_ZHUANGJB
 *
 */
@RestController
@RequestMapping("/app")
public class MemberController {
	
	@Autowired
	private MemberService memberService;
	
	/**
	 * 通过uid 进行查询
	 * @param uid
	 * @return
	 * @throws Exception
	 */
	@RequestMapping("/findUid/{uid}")
	 public Member findByUid (@PathVariable("uid") long uid) throws Exception{
		return memberService.getByUid(uid);
	}
	
	/**
	 * 通过eid 进行查询
	 * @param eid
	 * @return
	 * @throws Exception
	 */
	@RequestMapping("/findEid/{eid}")
	public Member findByEid (@PathVariable ("eid") Integer eid) throws Exception{
		return memberService.getByEid(eid);
	}
	
	@RequestMapping("/findAll")
	public Member findAll() throws Exception{
		return memberService.findALL();
	}
	
}
